package com.leo.offer;

/**
 * 懒汉式单例：需要注意线程安全,效率偏低，锁住了整个class
 * @author xuexiaolei
 * @version 2018年03月01日
 */
public class T02Singleton02 {
    private static T02Singleton02 instance = null;
    private T02Singleton02(){}

    public static synchronized T02Singleton02 getInstance() {
        if (instance==null){
            instance = new T02Singleton02();
        }
        return instance;
    }
}
